import { isAuth } from '@/utils/auth'
import { Navigate } from 'react-router-dom'
import { ReactElement } from 'react'
type Props = {
  element: ReactElement
}
function Nav(props: Props) {
  return <> {isAuth() ? props.element : <Navigate to={'/login'} />}</>
}

export default Nav
